<?php
require_once("../config.php");
require_once("common_parameters.php");

$t = $_GET['t'];
$paramInfo = $paramArray[$t];

/*$createSql = "CREATE TABLE IF NOT EXISTS object_city (
  id int(11) unsigned NOT NULL AUTO_INCREMENT,
  val varchar(100) CHARACTER SET utf8 NOT NULL,
  status tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1";
$dsql->SetQuery($createSql);
$dsql->ExecNoneQuery();*/
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?=$paramInfo['pageTitle']?></title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<script language="javascript" src="js/main.js"></script>
<script language="javascript" src="js/list.js"></script>
<script>
function deleteMsg(id, t)
{
	if(confirm("您确实要删除选中的记录吗?")){
		location.href = './delete.php?id=' + id + '&t=' + t;
	}
}
</script>
</head>
<body leftmargin="8" topmargin="8" background='images/allbg.gif' onLoad="ContextMenu.intializeContextMenu()">

<!--  内容列表   -->
<form name="form2">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7" >
	<td height="28" colspan="10" background="images/tbg.gif" style="padding-left:10px;">
	◆ <?=$paramInfo['listTitle']?>
	</td>
</tr>
<tr align="center" bgcolor="#FBFCE2" height="25">
	<td width="30">ID</td>
	<td width=""><?=$paramInfo['mainFieldTitle']?></td>
	<!-- <td width="50">状态</td> -->
	<td width="100">操作</td>
</tr>
<?php
$dsql->SetQuery("select * From " . $paramInfo['tableName'] . " where status = '1'");
$dsql->Execute();
$i = 1;
while($row = $dsql->GetArray()){
?>
<tr align="center" bgcolor="#FFFFFF" height="25">
	<td width="30"><?=$i?></td>
	<td align="left">&nbsp;<?=$row['val']?></td>
	<!-- <td width="50"><?=$row['status']?></td> -->
	<td width="100">
		<a href="./edit.php?id=<?=$row['id']?>&t=<?=$t?>">修改</a>&nbsp;
		<a href="#" onclick="deleteMsg('<?=$row['id']?>', '<?=$t?>');">删除</a>
	</td>
</tr>
<?php
	$i++;
}
?>
<tr bgcolor="#ffffff">
	<td height="36" colspan="10">
		&nbsp;
		<a href="add.php?t=<?=$t?>" class="coolbg">增加</a>
	</td>
</tr>
</form>
<tr align="right" bgcolor="#F9FCEF">
	<td height="36" colspan="10" align="center">
		<span>共 <?=($i - 1)?> 条记录</span>
	</td>
</tr>
</table>
</body>
</html>